package com.jic.market.service;

import com.jic.market.entity.PatchGrouponStockLmtEntity;
import com.jic.market.entity.PromotionLimitRuleEntity;
import com.jic.market.model.LimitQueryUniqueCondition;
import com.jic.market.request.PatchGouponProductRequest;
import com.jic.market.request.PatchGrouponUpdateStockLimitRequest;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品限制服务
 *
 * @author guohuayong
 * @date: 2020年02月26日
 */
public interface PatchGrouponStockLmtService {

    /**
     * 判断商品是否存在
     * @param promotionId
     * @param mpId
     * @return
     */
    PatchGrouponStockLmtEntity getEntityByPromotionIdAndMpId(Long promotionId, Long mpId);    /**

     * 判断商品是否存在new
     * @param condition
     * @return
     */
    PatchGrouponStockLmtEntity getEntityLimitQueryUniqueCondition(LimitQueryUniqueCondition condition);

    /**
     * 添加商品
     * @param limitEntity
     */
    Integer addPromotionLimitRule(PatchGrouponStockLmtEntity limitEntity);

    /**
     * 根据活动id 商品id 更新
     * @param pgpr
     * @return
     */
    Integer updateByPromotionIdMpId(PatchGouponProductRequest pgpr);

    /**
     * 根据 id 更新
     * @param pgpr
     * @return
     */
    Integer updateLimitById(PatchGrouponUpdateStockLimitRequest pgpr);


    /**
     * 根据 促销id 和 商品id 删除
     * @param promotionId
     * @param productId
     * @return
     */
    Integer deleteEntityByPromotionIdAndMpId(Long promotionId, Long productId);


    /**
     * 根据 促销id 和 商品id 删除
     * @param patchGrouponMpId
     * @return
     */
    Integer deleteByPatchGrouponMpId(Long patchGrouponMpId);

    /**
     * 查询限制列表
     * @param limitEntity
     * @return
     */
    List<PatchGrouponStockLmtEntity> findAll(PatchGrouponStockLmtEntity limitEntity);


    /**
     * 根据促销id 和 店铺id 删除stock 限制项
     * @param promotionId
     * @param storeIds
     * @return
     */
    Integer deleteEntityListByPromotionIdAndStoreIdsBatch(Long promotionId, List<Long> storeIds);

    /**
     * 添加商品
     * @param
     */
    Integer insertBatch(List<PatchGrouponStockLmtEntity> list);


}
